<?php
require '../inc/inc.php';
$itemList = C('item/item_list');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>物品列表</title>
</head>

<body>
<table width="500" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <th bgcolor="#FFFFFF">物品ID</th>
    <th bgcolor="#FFFFFF">物品名称</th>
    <th bgcolor="#FFFFFF">物品类型ID</th>
    <th bgcolor="#FFFFFF">物品等级</th>
    <th bgcolor="#FFFFFF">技能ID</th>
  </tr>
<?php foreach ($itemList as $item_id=>$item) { ?>
<?php 
$cropList = C('item/crop');
$fruitList = C('item/fruit');
$animalList = C('item/animal');
$gatherList = C('item/gather');
if ($item_id == 100) {
	$skillId = 0;
} else if ($item_id < 100) {
	$skillId = $cropList[$item_id]['skill_id'];
} else if ($item_id < 200) {
	$skillId = $fruitList[$item_id]['skill_id'];
} else if ($item_id < 300) {
	$skillId = $animalList[$item_id]['skill_id'];
} else if ($item_id < 400) {
	$skillId = $animalList[$item_id-100]['skill_id'];
} else if ($item_id > 400 && $item_id < 500) {
	$skillId = $gatherList[$item_id]['skill_id'];
} else {
	$skillId = 0;
}
?>
  <tr>
    <td bgcolor="#FFFFFF" align="center"><?php echo $item_id;?></td>
    <td bgcolor="#FFFFFF" align="center"><?php echo $item['title'];?></td>
    <td bgcolor="#FFFFFF" align="center"><?php echo $item['type'];?></td>
    <td bgcolor="#FFFFFF" align="center"><?php echo $item['lvl'];?></td>
    <td bgcolor="#FFFFFF" align="center"><?php echo $skillId;?></td>
  </tr>
<?php } ?>
</table>
</body>

</html>